package cn.jeeweb.modules.web.labor.service.impl;

import cn.jeeweb.core.common.service.impl.CommonServiceImpl;
import cn.jeeweb.modules.web.labor.content.SelectTreeContent;
import cn.jeeweb.modules.web.labor.mapper.HuTrainNoticeMapper;
import cn.jeeweb.modules.web.labor.entity.HuTrainNotice;
import cn.jeeweb.modules.web.labor.service.IHuTrainNoticeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**   
 * @Title: hu_train_notice
 * @Description: hu_train_notice
 * @author &Iacute;&otilde;&acute;&aelig;&frac14;&ucirc;
 * @date 2018-02-07 10:15:33
 * @version V1.0   
 *
 */
@Transactional
@Service("huTrainNoticeService")
public class HuTrainNoticeServiceImpl  extends CommonServiceImpl<HuTrainNoticeMapper,HuTrainNotice> implements  IHuTrainNoticeService {



    @Resource
    private HuTrainNoticeMapper huTrainNoticeMapper;

    public SelectTreeContent selectTreeContent(){
        SelectTreeContent  selectTreeContent=huTrainNoticeMapper.selectTree(null).get(0);
        List<SelectTreeContent> children=null;
        if(selectTreeContent!=null){
            children=huTrainNoticeMapper.selectTree(selectTreeContent.getId());
        }
        selectTreeContent.setChildren(children);
        return selectTreeContent;
    }
}
